#include "rs485_hardware_driver_common.h"

void rs485_hw_struct_register(struct rs485_hw *rs485_hw,
                              void (*set_oe_to_send)(void),
                              void (*set_oe_to_receive)(void),
                              void (*start_to_send)(void),
                              void (*stop_to_send)(void),
                              uint8_t (*check_receive_interrupt_registers_data)(uint8_t *byte),
                              void (*start_receive_timeout_timer)(void),
                              void (*enable_txe_empty_interrupt)(void),
                              void (*send_out_one_byte)(uint8_t data),
                              uint8_t (*check_txe_empty_interrupt)(void),
                              void (*enable_wait_tc_empty_interrupt)(void),
                              uint8_t (*check_tc_empty_interrupt)(void),
                              uint8_t (*check_receive_timeout_timer_interrput)(void),
                              void (*rs485_hard_init)(void))
{
    rs485_hw->set_oe_to_send = set_oe_to_send;
    rs485_hw->set_oe_to_receive = set_oe_to_receive;
    rs485_hw->start_to_send = start_to_send;
    rs485_hw->stop_to_send = stop_to_send;
    rs485_hw->check_receive_interrupt_registers_data = check_receive_interrupt_registers_data;
    rs485_hw->start_receive_timeout_timer = start_receive_timeout_timer;
    rs485_hw->enable_txe_empty_interrupt = enable_txe_empty_interrupt;
    rs485_hw->send_out_one_byte = send_out_one_byte;
    rs485_hw->check_txe_empty_interrupt = check_txe_empty_interrupt;
    rs485_hw->enable_wait_tc_empty_interrupt = enable_wait_tc_empty_interrupt;
    rs485_hw->check_tc_empty_interrupt = check_tc_empty_interrupt;
    rs485_hw->check_receive_timeout_timer_interrput = check_receive_timeout_timer_interrput;
    rs485_hard_init();
}
